package com.hsogoo.avatar.registry;

import com.google.common.collect.Maps;
import com.hsogoo.avatar.model.ProviderMethod;

import java.util.Map;

/**
 * @Author huangsaigang
 * Created @2018/9/29.
 */
public class ProviderMethodRegistry {

    private static Map<String, ProviderMethod> providerRegistries = Maps.newConcurrentMap();

    public static void register(String key, ProviderMethod providerMethod){
        providerRegistries.put(key, providerMethod);
    }

    public static ProviderMethod getProviderMethod(String key){
        if(providerRegistries.containsKey(key)){
            return providerRegistries.get(key);
        }
        return null;
    }
}
